﻿CREATE PROCEDURE [dbo].[yaf_smiley_list](
                @BoardID  INT,
                @SmileyID INT  = NULL)
AS
    BEGIN
        IF @SmileyID IS NULL
        SELECT   *
        FROM     yaf_Smiley
        WHERE    BoardID = @BoardID
        ORDER BY Len(Code) DESC
        ELSE
        SELECT *
        FROM   yaf_Smiley
        WHERE  SmileyID = @SmileyID
    END


